import request ,{BASEURL}from '@/utils/request.js'; // 封装的request.js文件的位置
// 获取用户信息
export const getUserInfo = (data)=>{
	return request('/mobile/user/getUserInfo',"GET",data)
}
// 根据elderId获取老人信息
export const getElderInfo = (data)=>{
	return request('/mobile/elder/getElderInfo',"GET",data)
}
// 根据楼栋-楼层-房间查询老人列表
export const listVisitForGuard = (data)=>{
	return request('/mobile/elder/listVisitForGuard',"GET",data)
}

//上传接口
export const uploadAvatar = (file)=>{
 return new Promise((resolve,reject)=>{
		uni.uploadFile({
			url:`${BASEURL}/pad/elderInfo/avatar`,
			filePath:file.avatarfile,
			header: {
			 "Authorization":  uni.getStorageSync("token"),
		    },
			name:"avatarfile",
			success:res=>{
			 const params = JSON.parse(res.data)
			 resolve(params)
			},
			fail(e) {
				reject(e)
			}
		})
	})

}